import React, { useState,useEffect } from 'react'
import Tabel from '../../comments/Tabel';
import SearchBar from '../../components/SearchBar';
import Detail from './detail/Detail';

export default function PendingContrant() {
  const [isFalse,setIsfalse] = useState(true)
  const [currentData,setCurrentData] = useState([])
  

  //接收子组件传来的值
  const sendData = (data:any)=>{
    console.log(data)
    setIsfalse(data.isFalse)
    if(data.data){
      setCurrentData(data.data)
    }
  }
  //页面更新
  useEffect(()=>{
  },[])
  return (
    <>
      {
        isFalse && <div>
          <SearchBar></SearchBar>
          <Tabel sendData={sendData} isFalse={isFalse}></Tabel>
        </div>
      }
      {
        !isFalse && <div>
            <Detail sendData={sendData} currentData={currentData}></Detail>
        </div>
      }
    </>
    


  )
}
